package org.pentaho.cubic.client.dialogs;


import com.google.gwt.core.client.GWT;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.uibinder.client.UiHandler;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.DialogBox;
import com.google.gwt.user.client.ui.HTML;
import com.google.gwt.user.client.ui.Widget;

public class NotificationDialog extends DialogBox{

	private static NotificationDialogUiBinder uiBinder = GWT
			.create(NotificationDialogUiBinder.class);

	interface NotificationDialogUiBinder extends UiBinder<Widget, NotificationDialog> { }

	public NotificationDialog() {
		setWidget(uiBinder.createAndBindUi(this));
	}

	@UiField HTML html;
	@UiField Button button;
	
	public NotificationDialog(String caption, String text) {
		this.setGlassEnabled(true);
		//this.setAutoHideEnabled(true);
		
		setWidget(uiBinder.createAndBindUi(this));
		
		this.setHTML(caption);
		html.setHTML(text);
	}

	public void setTitle(String text) {
		this.setHTML(text);
	}
	
	public void setText(String text) {
		html.setHTML(text);
	}
	
	@UiHandler("button")
	void onClick(ClickEvent e) {
		this.hide();
	}
	
	
}
